﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Vit.Common
{
    public class Triple<T, U, V>
    {
        public Triple()
        {
        }

        public override int GetHashCode()
        {
            return this.First.GetHashCode() ^ this.Second.GetHashCode() ^ this.Third.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            return ((obj != null) && (obj is Triple<T, U, V>) && (this == (Triple<T, U, V>)obj));
        }

        public static bool operator ==(Triple<T, U, V> lhs, Triple<T, U, V> rhs)
        {
            return (lhs.First.Equals(rhs.First) && lhs.Second.Equals(rhs.Second) && lhs.Third.Equals(rhs.Third));
        }

        public static bool operator !=(Triple<T, U, V> lhs, Triple<T, U, V> rhs)
        {
            return !(lhs == rhs);
        }

        public T First { get; set; }

        public U Second { get; set; }

        public V Third { get; set; }
    }
}
